Skip to content

feat(go/adbc): refactor logging instrumentation into OTel tracing - part 3/3 - #4661

Draft
birschick-bq wants to merge 13 commits into
apache:mainfrom
birschick-bq:dev/birschick-bq/flight-sql-log-to-trace-5-statements
Draft

feat(go/adbc): refactor logging instrumentation into OTel tracing - part 3/3#4661
birschick-bq wants to merge 13 commits into
apache:mainfrom
birschick-bq:dev/birschick-bq/flight-sql-log-to-trace-5-statements

Conversation

@birschick-bq

Copy link
Copy Markdown
Contributor

This pull request refactors the FlightSQL driver's statement execution and bulk ingest logic to improve observability by replacing custom logging with structured OpenTelemetry tracing. It introduces detailed span events and attributes for all major statement operations, ensures errors are properly recorded, and fingerprints queries in a privacy-preserving way. The changes also update key helper functions to generate OpenTelemetry attributes and clean up legacy logging code.

Tracing and Observability Improvements:

  • All statement operations (SetSqlQuery, ExecuteQuery, ExecuteUpdate, Prepare, and bulk ingest) now create OpenTelemetry spans, add structured events/attributes, and record errors with stack traces for better traceability.
  • Query and Substrait plan fingerprinting is now performed via new helper functions that generate OpenTelemetry attributes with only the query length and SHA-256 prefix, avoiding PII exposure.
  • Logging via slog has been removed from statement execution paths in favor of OpenTelemetry events and attributes.

API and Helper Updates:

  • Helper functions such as queryAttrs, flightInfoTracingKeyValues, and correlation header attribute generators have been updated to return OpenTelemetry attribute.KeyValue slices instead of generic any slices.
  • Imports have been updated to remove unused logging and add OpenTelemetry packages where required.

Testing:

  • Added a test to ensure that trace files are cleaned up after construction failures, improving test coverage for telemetry-related resource management.

Extends: #4659
Part 3/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants